home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source1.lha / source / amiga / Disk.mod < prev    next >
Encoding:
Text File  |  1995-01-26  |  3.5 KB  |  151 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: Disk.mod $
  4.   Description: Interface to disk.resource
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.7 $
  8.       $Author: fjc $
  9.         $Date: 1995/01/26 02:39:55 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
  23. <*$ CaseChk-  IndexChk- LongVars+ NilChk-  *>
  24. <*$ RangeChk- StackChk- TypeChk-  OvflChk- *>
  25.  
  26. MODULE [2] Disk;
  27.  
  28. IMPORT e := Exec, s := Sets;
  29.  
  30.  
  31. (*
  32. **      $VER: disk.h 27.11 (21.11.90)
  33. **
  34. **      disk.h -- external declarations for the disk resource
  35. *)
  36.  
  37.  
  38. (********************************************************************
  39. *
  40. * Resource structures
  41. *
  42. ********************************************************************)
  43.  
  44.  
  45. TYPE
  46.  
  47.   DiscResourceUnitPtr * = POINTER TO DiscResourceUnit;
  48.   DiscResourceUnit * = RECORD (e.MessageBase)
  49.     message *   : e.Message;
  50.     discBlock * : e.Interrupt;
  51.     discSync *  : e.Interrupt;
  52.     index *     : e.Interrupt;
  53.   END; (* DiscResourceUnit *)
  54.  
  55.   DiscResourcePtr * = POINTER TO DiscResource;
  56.   DiscResource * = RECORD (e.LibraryBase)
  57.     library *     : e.Library;
  58.     current *     : DiscResourceUnitPtr;
  59.     flags *       : s.SET8;
  60.     pad *         : e.UBYTE;
  61.     sysLib *      : e.LibraryPtr;
  62.     ciaResource * : e.LibraryPtr;
  63.     unitID *      : ARRAY 4 OF e.ULONG;
  64.     waiting *     : e.List;
  65.     discBlock *   : e.Interrupt;
  66.     discSync *    : e.Interrupt;
  67.     index *       : e.Interrupt;
  68.     currTask *    : e.TaskPtr;
  69.   END; (* DiscResource *)
  70.  
  71. CONST
  72.  
  73. (* DiscResource.drFlags entries *)
  74.   alloc0      * = 0;       (* unit zero is allocated *)
  75.   alloc1      * = 1;       (* unit one is allocated *)
  76.   alloc2      * = 2;       (* unit two is allocated *)
  77.   alloc3      * = 3;       (* unit three is allocated *)
  78.   active      * = 7;       (* is the disc currently busy? *)
  79.  
  80.  
  81. (********************************************************************
  82. *
  83. * Hardware Magic
  84. *
  85. ********************************************************************)
  86.  
  87. CONST
  88.  
  89.   dskDMAOff       * = 4000H;  (* idle command for dsklen register *)
  90.  
  91.  
  92. (********************************************************************
  93. *
  94. * Resource specific commands
  95. *
  96. ********************************************************************)
  97.  
  98. CONST
  99.  
  100.   diskName * = "disk.resource";
  101.  
  102. (********************************************************************
  103. *
  104. * drive types
  105. *
  106. ********************************************************************)
  107.  
  108. CONST
  109.  
  110.   amiga       * = 00000000H;
  111.   drt37422D2S * = 55555555H;
  112.   empty       * = 0FFFFFFFFH;
  113.   drt150RPM   * = 0AAAAAAAAH;
  114.  
  115.  
  116. (**-- Resource Base variable --------------------------------------------*)
  117.  
  118.  
  119. VAR
  120.  
  121.   base * : DiscResourcePtr;
  122.  
  123.  
  124. (**-- Resource Functions ------------------------------------------------*)
  125.  
  126. (*
  127. **      $VER: disk_protos.h 36.1 (19.2.91)
  128. *)
  129.  
  130. PROCEDURE AllocUnit* [base,-6]
  131.   ( unitNum [0] : LONGINT )
  132.   : BOOLEAN;
  133. PROCEDURE FreeUnit* [base,-12]
  134.   ( unitNum [0] : LONGINT );
  135. PROCEDURE GetUnit* [base,-18]
  136.   ( unitPointer [8] : DiscResourceUnitPtr )
  137.   : DiscResourceUnitPtr;
  138. PROCEDURE GiveUnit* [base,-24] ();
  139. PROCEDURE GetUnitID* [base,-30]
  140.   ( unitNum [0] : LONGINT )
  141.   : LONGINT;
  142.  
  143. (* ------ new for V37 ------*)
  144.  
  145. PROCEDURE ReadUnitID* [base,-36]
  146.   ( unitNum [0] : LONGINT )
  147.   : LONGINT;
  148.  
  149. BEGIN base := NIL
  150. END Disk.
  151.